package Prova::FileMgr;

use strict;
use warnings;

=head1 NAME

Prova::FileMgr

=head1 DESCRIPTION

none

=head1 METHODS

=cut

=head2 put

=cut

sub put {
    my ( $self, $path, $data ) = @_;

    eval {
        open my $fh, ">", $path or die "Can't write data to $path.";
        print $fh $data;
        close $fh;
    };

    return $@ ? 0 : 1;
}

=head2 get

=cut

sub get {
    my ( $self, $path ) = @_;

    my $fh;
    open $fh , $path or die "Opening file $path failed.";
    my $data;
    {
        local $/;
        $data = <$fh>;
    }
    close $fh;

    $data;
}

=head2 errstr

=cut

sub errstr {}

=head1 AUTHOR

Shanon Inc, E<lt>http://www.shanon.co.jp/E<gt>

=head1 LICENSE

This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;
